/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "../manager/plugin_manager.h"
#include "main_template.h"
#include "../UIMotionAnimationCapiAnimator/ui_motion_animation_capi_animator_test.h"
#include "../UIMotionAnimationCapi/ui_motion_animation_capi_test.h"
#include "../UIMotionAnimationAnimatetoIcurve/ui_motion_animation_animateto_icurve_test.h"
#include <iostream>

#define INVALID_PARAM 401

namespace ArkUICApiDemo {
static ArkUI_NodeHandle rootNode;
static ArkUI_NativeNodeAPI_1 *nodeAPI;
using FunctionCallBack = std::function<void(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle& rootNode)>;
static std::unordered_map<std::string, FunctionCallBack> xComponentToCreateNativeNode_ = {};
static bool hasInit = false;

void Initialize() {
    xComponentToCreateNativeNode_ = {
        // UIMotionAnimationCapiAnimator
        {"AnimationCapiAnimator0010PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0010, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0020PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0020, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0030PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0030, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0040PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0040, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0050PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0050, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0060PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0060, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0070PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0070, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0080PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0080, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0090PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0090, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0100PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0100, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0110PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0110, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0120PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0120, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0130PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0130, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0140PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0140, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0150PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0150, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0160PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0160, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0170PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0170, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0180PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0180, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0190PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0190, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0200PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0200, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0210PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0210, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0220PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0220, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0230PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0230, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0240PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0240, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0250PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0250, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0260PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0260, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0270PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0270, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0280PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0280, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0310PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0310, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0320PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0320, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0330PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0330, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0340PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0340, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0350PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0350, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0360PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0360, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0370PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0370, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0380PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0380, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0390PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0390, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0400PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0400, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0410PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0410, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0420PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0420, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0430PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0430, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0440PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0440, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0450PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0450, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0460PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0460, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0470PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0470, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0480PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0480, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0490PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0490, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0500PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0500, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0510PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0510, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0520PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0520, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0530PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0530, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0540PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0540, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0550PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0550, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0560PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0560, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0580PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0580, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0590PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0590, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0600PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0600, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0610PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0610, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0620PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0620, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0630PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0630, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0640PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0640, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0650PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0650, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0660PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0660, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0670PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0670, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0680PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0680, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0690PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0690, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0700PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0700, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0710PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0710, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0720PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0720, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0730PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0730, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0740PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0740, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0750PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0750, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0760PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0760, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0770PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0770, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0780PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0780, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0790PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0790, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0800PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0800, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0810PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0810, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0820PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0820, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0830PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0830, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0840PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0840, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0850PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0850, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0860PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0860, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapiAnimator0870PageTest", std::bind(&UIMotionAnimationCapiAnimator::CreateMotionAnimationCapiAnimator0870, std::placeholders::_1, std::placeholders::_2)},
        // UIMotionAnimationCapi
        {"AnimationCapi0010PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0010, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0020PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0020, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0030PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0030, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0040PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0040, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0050PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0050, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0060PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0060, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0070PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0070, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0080PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0080, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0090PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0090, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0100PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0100, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0110PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0110, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0120PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0120, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0130PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0130, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0140PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0140, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0150PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0150, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0160PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0160, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0170PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0170, std::placeholders::_1, std::placeholders::_2)},
        {"AnimationCapi0180PageTest", std::bind(&UIMotionAnimationCapi::CreateNativeNodeMotionAnimationCapi0180, std::placeholders::_1, std::placeholders::_2)},
        // UIMotionAnimationAnimatetoIcurve
        {"AnimatetoIcurve0010PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0010, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0020PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0020, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0030PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0030, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0040PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0040, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0050PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0050, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0060PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0060, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0070PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0070, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0080PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0080, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0090PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0090, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0100PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0100, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0110PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0110, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0120PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0120, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0130PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0130, std::placeholders::_1, std::placeholders::_2)},
        {"AnimatetoIcurve0140PageTest", std::bind(&UIMotionAnimationAnimatetoIcurve::CreateNativeNodeMAAIcurve0140, std::placeholders::_1, std::placeholders::_2)},

        // add new native node...
    };
}

void DistributeAndCreateNodeByXComponentId(const std::string& componentId)
{
    if (!hasInit) {
        Initialize();
    }
    auto itor = xComponentToCreateNativeNode_.find(componentId);
    if (itor != xComponentToCreateNativeNode_.end()) {
        itor->second(nodeAPI, rootNode);
    } else {
        OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "DistributeEvent", "can not find xComponentId : %{public}s", componentId.c_str());
    }
    
}

napi_value MainTemplate::NativeCapiMainTest(napi_env env, napi_callback_info info)
{
    // 获取id
    size_t argc = 1;
    napi_value args[1] = {nullptr};
    napi_get_cb_info(env, info, &argc, args, nullptr, nullptr);
    size_t length = 64;
    size_t strLength = 0;
    char xComponentID[64] = {0};
    napi_get_value_string_utf8(env, args[0], xComponentID, length, &strLength);
    OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI);
    // 按照XComponentId分发事件，并创建rootNode组件
    std::string xComponentIdStr(xComponentID);
    DistributeAndCreateNodeByXComponentId(xComponentIdStr);
    // 绑定NativeXComponent 和 rootNode
    OH_NativeXComponent_AttachNativeRootNode(PluginManager::GetInstance()->GetNativeXComponent(xComponentIdStr), rootNode);
    napi_value exports;
    napi_create_object(env, &exports);

    return exports;
}
} // namespace ArkUICApiDemo